package com.lantosec.hmrp.modules.internal.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.modules.internal.entity.InternalTask;
import com.lantosec.hmrp.core.mvc.BaseVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 评价任务 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="InternalTask对象", description="评价任务")
public class InternalTaskVO extends BaseVO<InternalTask> {
    private static final long serialVersionUID = 1L;


    public InternalTaskVO(InternalTask entity){
        this.internalTaskId = entity.getInternalTaskId();
        this.internalPlanId = entity.getInternalPlanId();
        this.internalPlanType = entity.getInternalPlanType();
        this.taskTitle = entity.getTaskTitle();
        this.startDate = entity.getStartDate();
        this.endDate = entity.getEndDate();
        this.state = entity.getState();
        this.delay = entity.getDelay();
        this.executorUserNum = entity.getExecutorUserNum();
        this.performUserNum = entity.getPerformUserNum();
    }

    @Override
    public InternalTask convertToEntity(){
        return new InternalTask(this);
    }


    @ApiModelProperty(value = "评价任务ID")
    @TableId(value = "internal_task_id", type = IdType.AUTO)
    private Integer internalTaskId;

    @ApiModelProperty(value = "评价方案ID")
    private Integer internalPlanId;

    @ApiModelProperty(value = "方案类型")
    private Integer internalPlanType;

    @ApiModelProperty(value = "任务标题")
    private String taskTitle;

    @ApiModelProperty(value = "任务开始日期")
    private String startDate;

    @ApiModelProperty(value = "任务结束日期")
    private String endDate;

    @ApiModelProperty(value = "任务状态(1暂停 2启用 3到期 4作废)")
    private Integer state;

    @ApiModelProperty(value = "允许延期(工作日)")
    private Integer delay;

    @ApiModelProperty(value = "评价人总数(参评人数)")
    private Integer executorUserNum;

    @ApiModelProperty(value = "完成评价的人数")
    private Integer performUserNum;

    @ApiModelProperty(value = "考评任务明细")
    private Integer internalTaskDetailId;
    @ApiModelProperty(value = "考评方id")
    private String executorId;

    @ApiModelProperty(value = "进度")
    private Integer percent;

    @ApiModelProperty(value = "评价人部门")
    @TableField(exist = false)
    private String executorDeptId;
}
